using System;
using Wikey.Extensibility.Classes;
using Wikey.Extensibility.Interfaces;
using Wikey.Interfaces.Attributes;

namespace Wikey.Transformations.Plugin
{
    [Transformer(Command ="IFrame")]
    public class FrameTransformer : ITransformer 
    {
        public string Command
        {
            get { throw new NotImplementedException(); }
        }

        public TransformationResult Apply(IExpressionFunction function)
        {
            if (!String.IsNullOrEmpty(function.Value)) {
                return new TransformationResult
                    {
                        Html = String.Format(
                            "<iframe src='{0}' style='border:none;width:98%;height:800px;overflow:auto;'></iframe>" , function.Value
                            )
                    };
            }
            else
            {
                return new TransformationResult();
            }
        }

        public bool AcceptDirectParameter
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }
    }
}